# -*- coding: utf-8 -*-
# @author: wch
# @file: resize.py
# @time: 2023/2/8 17:46

# resize(src,dst,dsize,fx,fy,interpolation)
# fx:x轴的缩放因子
# fy：y轴的缩放因子
# 如果设置了dsize，则没有 必要设置fx，和fy
# interpolation 差值的算法 INTER_NEAREST-邻近差值 INTER_LINEAR 双线性差值  INTER_CUBIC,三次差值  INTER_AREA 效果最好

import cv2
import numpy as np

img = cv2.imread(r"E:\code\opencv\media\1.jpg")
# new =cv2.resize(img,(400,400)) # 默认双线性差值
new =cv2.resize(img,None,fx=0.3,fy=0.3,interpolation=cv2.INTER_AREA)

cv2.imshow("img",img)
cv2.imshow("new",new)
cv2.waitKey(0)
cv2.destroyAllWindows()











































































































































































































































































































































